{% extends "menubase.html" %}
{% block panel %}
{% load static %}
<div class="weui-panel weui-panel_access">
    <style>
        .weui-media-box img{width:50px;height:50px;}
    </style>
    <div class="weui-panel__bd">
        {%if address is None%}
            <a href="/newAddress/{{request.META.PATH_INFO}}" class="weui-flex" style="align-items: center;justify-content: flex-start;padding: 10px 15px;">
                    <div style="width:32px;height: 32px;line-height: 32px;padding-right: 0.8em;">
                        <img src="{%static 'icons/jia.png'%}" alt="">
                    </div>
                    <h4 class="weui-media-box__title">添加收货地址</h4>
            </a>
        {%else%}
            <a class="weui-cell weui-cell_access" href="/address">
                    <div class="weui-cell__bd weui-cell_primary">
                        <h4>
                            <span>{{address.receive_name}}</span>
                            <span>{{address.name}}</span>
                            <span class="weui-badge" style="margin-left: 5px;">收货地址</span>
                        </h4>
                        <p>
                            <span style="font-size:14px;">{{address.location}}{{address.detail}}</span>
                        </p>
                    </div>
                    <span class="weui-cell__ft"></span>
            </a>
        {%endif%}
        <div class="weui-media-box weui-media-box_text" style="color: #999999;">
        活动列表
        </div>
        {%for active in activeinfos%}
            <div class="weui-media-box weui-media-box_text">
                <a href="/{{active.type}}/{{active.activeid}}">
                    <div class="weui-flex">
                        <div style="width:50px;position: relative;margin-right: .8em;">
                            <img src="{{active.thumb}}"  alt=""  />
                            {%if not active.watch%}
                            <span class="weui-badge weui-badge_dot" style="position: absolute;top: -2px;right: 0px;"></span>
                            {%endif%}
                        </div>
                        <div class="weui-flex__item">
                            <span style="vertical-align: middle;font-weight: bold;font-size:14px;">{{active.name}}</span>
                            <span class="weui-badge" style="margin-left: 5px;">{{active.typename}}</span>
                            <p class="weui-media-box__desc">{{active.description}}</p>
                        </div>
                        <div>
                            {% if active.effective%}
                                <span style="color:#999999;font-size:13px;">正在进行</span>
                            {%else%}
                                <span style="color:#999999;font-size:13px;">已结束</span>
                            {%endif%}
                        </div>
                    </div>
                </a>
            </div>
        {%endfor%}
<!--         <div class="weui-media-box weui-media-box_text">
    <div class="weui-flex">
        <img src="{%static 'icons/active_party.png'%}"  alt="" style="margin-right: .8em;" />
        <div class="weui-flex__item">   
            <span style="vertical-align: middle;">免费的315聚餐服务</span>
            <span class="weui-badge" style="margin-left: 5px;">部落活动</span>
            <p class="weui-media-box__desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
        </div>
    </div>
</div>
<div class="weui-media-box weui-media-box_text">
    <div class="weui-flex">
        <img src="{%static 'icons/active_kuaidi.png'%}"  alt="" style="margin-right: .8em;" />
        <div class="weui-flex__item">   
            <span style="vertical-align: middle;">30分钟送达</span>
            <p class="weui-media-box__desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
        </div>
    </div>
</div> -->
        <div class="weui-media-box weui-media-box_text">
            <a href="/append">
            <div class="weui-flex">
                <div style="width:50px;position: relative;margin-right: .8em;">
                    <img src="{%static 'icons/active_append.png'%}"  alt=""  />
                </div>
                <div class="weui-flex__item">   
                    <span style="vertical-align: middle;font-size: 14px;font-weight: bold;">加入猫士部落</span>
                    <p class="weui-media-box__desc">由各种物质组成的巨型球状天体，叫做星球。星球有一定的形状，有自己的运行轨道。</p>
                </div>
            </div>
            </a>
        </div>
    </div>
</div>
<script>
    //更改首页导航处文字和图标颜色
    $(function(){
        $("#shop_active").addClass('weui-bar__item_on').find(".weui-tabbar__icon").attr('src','/static/icons/huodong_change.png');;
    })  
</script>
{% endblock %}